/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */

package com.xteam.xnetworkdisk.constant;


import java.io.File;
import java.util.Arrays;
import java.util.List;

public class Constant {
    public static final Integer SHARE_DEFAULT_EXPIRE_TIME = 30;
    public static final String VIDEO_SUFFIX  = "_thumbnail.png";

    public static final String VIDEO_THUMBNAIL  = "thumbnail";

//    public static final String FILE_LOCAL_PATH  = "http://139.9.202.40:88";

    public static final String FILE_LOCAL_PATH  = "http://127.0.0.1:88";

    public static final String PREVIEW_VIDEO  = "previewVideo";
    public static final String PREVIEW_SEGMENT  = "previewSegment";

    public static final Integer DETERMINE_UPLOAD_STRATEGY_RESUMABLE  = 202;

    public static final Integer DETERMINE_UPLOAD_STRATEGY_REGULAR  = 200;

    public static final Integer DETERMINE_UPLOAD_STRATEGY_INSTANT   = 201;

    public static final Integer DARK_MODE_DARK  = 1;

    public static final Integer DARK_MODE_LIGHT  = 0;

    public static final Integer SYNC_MODE_ASYNC  = 1;

    public static final Integer SYNC_MODE_SYNC  = 0;

    public static final Boolean ABNORMAL_EMAIL_ALERT_ON  = true;

    public static final Boolean ABNORMAL_EMAIL_ALERT_OFF  = false;


    public static final String USER_SPACE_OVER = "用户空间不足";

    public static final Long USER_DEFAULT_SPACE = 1024*1024*1024*8L;

    public static final String FILE_NOT_FOUND = "文件未找到";

    public static final String SYSTEM_INNER_ERROR = "系统内部异常";
    // 视频文件的 MIME 类型列表
    public static final List<String> VIDEO_CONTENT_TYPES = Arrays.asList(
            "video/mp4", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/x-ms-wmv","video/x-matroska"
    );
    public static final Integer TEMP_FOLDER = 0;

    public static final Integer LINK_VALIDITY_TIME = 60*60*24;

    public static final Integer THREAD_POOL_NUMBER = 5;

    public static final String VIDEO_INDEX_IMAGE_TPYE = "png";

    public static final String USER_AVATAR_BUKET = "xnetworkdisk-avatar";

    public static final String USER_FILE_BUKET = "xnetworkdisk";

    public static final String USER_BACKGROUND_BUKET = "xnetworkdisk-backgroud";

    public static final String USER_TS_BUKET = "xnetworkdisk-ts";

    public static final String FILE_ALREADY_EXISTED= "文件已存在";

    public static final String USER_NOT_AUTHENTICATED = "用户未授权";
    /**
     * 当前页码
     */
    public static final String PAGE = "page";
    /**
     * 每页显示记录数
     */
    public static final String LIMIT = "limit";
    /**
     * 排序字段
     */
    public static final String ORDER_FIELD = "sidx";
    /**
     * 排序方式
     */
    public static final String ORDER = "order";
    /**
     * 升序
     */
    public static final String ASC = "asc";
    /**
     * 分页参数描述
     */
    public static final String ISREAD = "1";

    /**
     * 基本分页参数描述
     */
    public static final String Params =
            "可选参数：（参数均为字符串）<br> " +
                    "page（当前页）<br> " +
                    "limit（每页显示记录数）<br>" +
                    "sidx（排序字段）<br> " +
                    "order（排序方式）<br> " +
                    "asc（升序）";

    /**
     * 消息分页参数是参数描述
     */
    public static final String MessageParams =Params +
                    "<br>isread（是否已读，0：未读，1：已读）";
    /**
     * 消息读取状态
     */
    public static final Integer MSG_READ = 1;

    public static final Integer MSG_NOT_READ = 0;

    /**
     * 默认的发送信息方
     */
    public static final String SENDER_DEFAULT = "未知";

    /**
     * App发送信息方
     */
    public static final Integer SENDER_APP = 3;

    /**
     * 斜线
     */
    public static final String SLASH = "/";

    /**
     * 连字符
     */
    public static final String HYPHEN = "-";
    /**
     * 冒号
     */
    public static final String COLON = ":";

    /**
     * 空字符串
     */
    public static final String EMPTY = "";

    /**
     * 下划线
     */
    public static final String UNDERSCORE = "_";
    public static final String SHELL_PROGRAM = "cmd.exe";
//    public static final String SHELL_PROGRAM = "bash";
    public static final Integer DEVICE_WINDOWS = 0;
    public static final Integer DEVICE_LINUX = 1;

//    public static final Integer DEVICE_TYPE =DEVICE_LINUX;
    public static final Integer DEVICE_TYPE =DEVICE_WINDOWS;


    private static final String DIRECTORY_PATH = System.getProperty("user.home") + File.separator + "xnetworkdisk";
    private static final String TOOLS_SUBDIRECTORY_PATH = DIRECTORY_PATH + File.separator + "tools";

    public static final Integer UPLOAD_FILE_SYNC = 0;
    public static final Integer UPLOAD_FILE_ASYNC = 1;
    public static final Integer UPLOAD_FILE_TYPE = UPLOAD_FILE_ASYNC;


    public static final Integer REMIND_DEFAULT_DAYS = 2;
    public static final String USER_SPACE_NOT_ENOUGH = "用户空间不足，请及时充值";
    public static final Integer TEMP_USER = 0;
    public static final String M3U8_SHELL_PATH = TOOLS_SUBDIRECTORY_PATH + File.separator + "convert_to_m3u8.bat";
//    public static final String M3U8_SHELL_PATH = TOOLS_SUBDIRECTORY_PATH + File.separator + "convert_to_m3u8.sh";

}
